package nl.memedefense.core;

import nl.memedefense.level.Level;
import nl.memedefense.level.Tile;
import nl.memedefense.level.ui.BuildableTile;
import nl.memedefense.monster.Monster;
import nl.memedefense.monster.Wave;
import nl.memedefense.monster.ui.Mudkip;
import nl.memedefense.screen.GameScreen;

import java.security.KeyStore;
import java.util.ArrayList;
import java.util.List;

/**
 * The game master is responsible for creating waves of monsters and orchestrating all game related actions.
 */
public class GameMaster {

    private int currentWaveNumber;

    /**
     * Creates a new GameMaster.
     */
    public GameMaster() {
        this.currentWaveNumber = 0;
    }

    /**
     * Retrieves the next {@link Wave} that should be rendered on screen.
     *
     * @return {@link Wave} of monsters that the player should fight next.
     */
    public Wave getNextWave() {
        Wave wave = new Wave(currentWaveNumber + 1);
        List<Monster> monsters = new ArrayList<Monster>();
        monsters.add(new Mudkip());
        wave.addMonstersToWave(monsters);
        return wave;
    }

    /**
     * Retrieves the level that user plays.
     *
     * @return {@link Level} that the user plays.
     */
    public Level getLevel() {
        Level level = new Level();
        Tile tile = new BuildableTile(1, 1);
        level.addTile(tile);

        return level;
    }
}
